PROJECTENGRAM

[HO] FUNCTIONS

Functions

Tags: #◇Problem Solving #◇Functions #◇Discrete Math #◇CCDSTRU #◇M6


◇Important Formulas & Concepts

Function (f:A→Bf: A \rightarrow B): A mapping from set AA to set BB where exactly one element of BB is assigned to each element of AA. Domain: The set AA. Codomain: The set BB. Image: If f(a)=bf(a) = b, then bb is the image of aa. Preimage: If f(a)=bf(a) = b, then aa is the preimage of bb. Range (Image of ff): The set of all actual images of ff (subset of the codomain).

Operations on Functions

Let f1f_1 and f2f_2 be functions from AA to R\mathbb{R}: Addition: (f1+f2)(x)=f1(x)+f2(x)(f_1 + f_2)(x) = f_1(x) + f_2(x) Multiplication: (f1f2)(x)=f1(x)f2(x)(f_1 f_2)(x) = f_1(x) f_2(x)

Function Properties

One-to-One (Injection)

A function is injective (one-to-one) if and only if f(a)=f(b)f(a) = f(b) implies a=ba = b for all a,ba, b in the domain. How to prove not one-to-one: Find an instance where f(x)=f(y)f(x) = f(y) but x≠yx \neq y.

Onto (Surjection)

A function is surjective (onto) if and only if for every element b∈Bb \in B (codomain), there is an element a∈Aa \in A (domain) such that f(a)=bf(a) = b. How to prove not onto: Find an element y∈By \in B such that no xx exists where f(x)=yf(x) = y.

One-to-One Correspondence (Bijection)

A function is bijective if it is both injective (one-to-one) and surjective (onto).

◇Worked Examples

Example 1: Function vs Not a Function
Let f:{a,b,c}→Zf: \{a, b, c\} \rightarrow \mathbb{Z} f(a)=1,f(b)=2,f(c)=3f(a) = 1, f(b) = 2, f(c) = 3 is a function because each element in the domain maps to exactly one element in the codomain. f(a)=1,f(b)=2,f(a)=3f(a) = 1, f(b) = 2, f(a) = 3 is not a function because aa maps to both 1 and 3.

Example 2: Injective / Surjective Analysis
Let f:Z→Zf: \mathbb{Z} \rightarrow \mathbb{Z} where f(x)=x2f(x) = x^2 Is it injective? No. f(1)=1f(1) = 1 and f(−1)=1f(-1) = 1, but 1≠−11 \neq -1. Is it surjective? No. There is no integer xx such that f(x)=−1f(x) = -1 (the image is always non-negative).

Let f:Z→Zf: \mathbb{Z} \rightarrow \mathbb{Z} where f(x)=x+1f(x) = x + 1 Is it injective? Yes. x+1=y+1  ⟹  x=yx+1 = y+1 \implies x = y. Is it surjective? Yes. For any y∈Zy \in \mathbb{Z}, let x=y−1x = y - 1. Then f(x)=y−1+1=yf(x) = y - 1 + 1 = y. Is it bijective? Yes, because it is both injective and surjective.

◇References & Navigation

[HO] Functions | PROJECT ENGRAM